package com.jy.api.healthreord.dto.zhikong;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

@Getter
@Setter
public class GuanLianXCXDto {
    @NotEmpty
    @ApiModelProperty("源数据集-如检验报告明细")
    private String tableSource;

    @NotEmpty
    @ApiModelProperty("目标数据集-如检验报告")
    private String tableTarget;

    @ApiModelProperty("查询的列")
    private List<String> columns;
    @ApiModelProperty("日期")
    private String startTime;
    @ApiModelProperty("日期")
    private String endTime;
    @ApiModelProperty("pageNo")
    private Integer pageNo;
    @ApiModelProperty("pageSize")
    private Integer pageSize;


    @NotNull
    @ApiModelProperty("两张表关联的字段")
    private List<GuanLianXSZD> linkedColumns;

    public Integer offset() {
        int _pageNo = pageNo == null || pageNo == 0 ? 1 : pageNo;
        return (_pageNo - 1) * pageSize;
    }
}
